package com.suxin.socket.vaca.model;

import lombok.Data;

import javax.websocket.Session;
import java.io.IOException;
import java.io.Serializable;

/**
 * @author Tang
 * @classname User
 * @description [  ]
 * @date 2021/4/1 16:16
 */
@Data
public class User implements LifecycleCtrl, Serializable {

    private Session session;

    private Integer id;

    private String name;

    private String registrationId;


    public void send(String wsResponseStr) {
        try {
            session
                    .getBasicRemote()
                    .sendText(wsResponseStr);
        } catch (IOException e) {
            e.printStackTrace();
        }

    }

    @Override
    public boolean sync() {
        return false;
    }

    @Override
    public void delete() {

    }

    @Override
    public void keepAlive() {

    }

    @Override
    public String generateKey() {
        return null;
    }

    @Override
    public void refresh() {

    }
}